<? session_start();
						
include_once ('core/conn.php');
						
$db = get_conn();
						
check_session();
						
					
?>
<html>
<head>
</head>				
<body>			
<form name='facility_type' method='post' action='core/facility_type.php' onsubmit='return checkdata(this)'>
				
<table width='100%' border='0'>
				  
	<tr>
	  <td valign='top'><a href="facility_type_form.php">Crear Nuevo Tipo</a></td>
    </tr>
	<tr>
					
		<td valign='top'><? 
			
		$sql = "select id_ftype as id,name as description from facility_type ";
			
		$result = mysql_query($sql);
			
		if($result){
				
			$data ="<table width='100%'>";
				
			if(mysql_num_rows($result) > 0){
					
				while($row = mysql_fetch_array($result)){
						
					$data .="<tr>
						<td align='left' >
							<a href='facility_type_form.php?id=".$row['id']."'>".$row['id']."</a>
						</td>
						<td align='left' >
							<a href='facility_type_form.php?id=".$row['id']."'>".$row['description']."</a>
						</td>						
						</tr>";
					
				}//while
				
			}//if
				
			else{
					
				$data .= "<tr><td align='center'>No hay facility_type registrados</td></tr>";			
				
			}
				
			$data .="</table>";
			
		}else{
				
			error_handling($sql,mysql_error());
			
		}
			
		echo $data;
			
		?> </td>
						
	</tr>
	<tr>
	  <td valign='top'>&nbsp;</td>
    </tr>
					
</table>
</form>
					
</body></html>					